import React, { useContext } from "react";
import {
  View,
  Text,
  StyleSheet,
  ScrollView,
  Modal,
  Dimensions,
  ActivityIndicator,
} from "react-native";
// import CustomImage from "../../components/CustomImage";
// // import ZoomImage from "../../components/ZoomImage";
// import ImageViewer from "react-native-image-zoom-viewer";
// import { ChildernContext } from "../../context/preparation/ChildernContext";
import ArticleDetailCard from "../../components/preAdmin/ArticleDetailCard";
import ArticleContext from "../../context/preparation/ArticleContext";
import NoData from "../../components/preAdmin/NoData";

// const Loading = () => {
//   return (
//     <View>
//       <ActivityIndicator animating={true} size={"large"} />
//     </View>
//   );
// };

// const savePhoto = () => {
//   console.log("保存到系统相册");
// };

const Organization = () => {
  const { articleList } = useContext(ArticleContext);
  const article = articleList.filter((item) => item.type === 2);
  if (article.length === 0) {
    return <NoData />;
  } else {
    return (
      <View style={styles.page}>
        <View style={{ marginBottom: 10 }}>
          <ArticleDetailCard article={article[0]} />
        </View>
      </View>
    );
  }
};

var styles = StyleSheet.create({
  page: {
    // marginTop: Platform.OS === "android" ? StatusBar.currentHeight : 0,
    height: "100%",
    backgroundColor: "white",
  },
});

export default Organization;
